package lk.icta.common.dao;

import lk.icta.common.entity.DSDivision;
import lk.icta.common.entity.GNDivision;
import lk.icta.user.entity.User;

import java.util.List;
import java.util.Map;

/**
 * @author Supun Nimesh Karunathilaka
 */
public interface GNDivisionDAO {
    /**
     * get GN Division by primary key
     *
     * @param gnDivisionUKey gn division primary key
     * @return GN division
     */
    public GNDivision getGNDivisionByPK(int gnDivisionUKey);

    /**
     * Return the list of GN Divisions by GN Division code and DS Division unique key and
     *
     * @param gnDivisionId the unique GN Division ID
     * @param dsDivision   the DS Division
     * @return the BD division object
     */
    public List<GNDivision> getGNDivisionByCodeAndDSDivision(int gnDivisionId, DSDivision dsDivision);

    /**
     * Return the list of GN Divisions by DS Division unique key and matching DN Division name in any language
     *
     * @param gnDivision
     * @param dsDivisionUKey the unique DS Division key
     * @param user           the user invoking the action
     * @return the list of matching GN Divisions
     */
    public List<GNDivision> getGNDivisionByAnyNameAndDSDivision(GNDivision gnDivision, int dsDivisionUKey, User user);

    /**
     * Return all GN Divisions by DS Division key
     *
     * @param dsDivisionId the unique DS Division id
     * @return list of GNDivisions corresponding to the ds division id
     */
    public List<GNDivision> getAllGNDivisionByDsDivisionKey(int dsDivisionId);

    /**
     * Return all GN Divisions by DS Division id
     *
     * @param dsDivisions list of ds divisions
     * @return list of GNDivisions corresponding to the ds division id
     */
    public List<GNDivision> getAllGNDivisionsByDistrictUKey(List<DSDivision> dsDivisions);

    /**
     * Add a new GN Division
     *
     * @param gnDivision division to be marked
     * @param user       user executing the operation
     */
    public void addGNDivision(GNDivision gnDivision, User user);

    /**
     * Update a GN Division
     *
     * @param gnDivision division to be updated
     * @param user       user executing the operation
     */
    public void updateGNDivision(GNDivision gnDivision, User user);

    /**
     * Returns the list of DSDivisions for the given language
     *
     * @param dsDivisionId the Ds DivisionId ID
     * @param language     the language ID (see AppConstants)
     * @param user         the user requesting the Division name list
     * @return a Map of known G.N. Divisions for the given language along with the ID
     */
    public Map<Integer, String> getGNDivisionNamesByDsDivisionId(int dsDivisionId, String language, User user);


}